package com.zygh.policeasset.mapper;

import com.zygh.policeasset.pojo.Role;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/* loaded from: police-asset-2.0-0.0.1-SNAPSHOT.jar:BOOT-INF/classes/com/zygh/policeasset/mapper/RoleMapper.class */
public interface RoleMapper {
    @Select({"select * from role"})
    @Results({@Result(property = "roleName", column = "role_name"), @Result(property = "findAll", column = "find_all"), @Result(property = "projectView", column = "project_view"), @Result(property = "contractEntry", column = "contract_entry")})
    List<Role> findAllRole();

    @Insert({"insert into role (role_name,permissions,find_all,project_view,contract_entry) values (#{roleName},#{permissions},#{findAll},#{projectView},#{contractEntry})"})
    Integer addRole(Role role);

    @Update({"<script>update role <set> <if test='roleName != null and roleName.length &gt; 0'>role_name = #{roleName}, </if><if test='permissions != null and permissions.length &gt; 0'>permissions = #{permissions}, </if><if test='findAll != null'>find_all = #{findAll}, </if><if test='projectView != null'>project_view = #{projectView}, </if><if test='contractEntry != null'>contract_entry = #{contractEntry}, </if></set> where id = #{id}</script>"})
    Integer updateRole(Role role);

    @Delete({"delete from role where id=#{id}"})
    Integer deleteRole(int i);

    @Select({"select permissions from role where id=#{id}"})
    String findById(int i);

    @Select({"select * from role where id=#{id}"})
    @Results({@Result(property = "roleName", column = "role_name"), @Result(property = "findAll", column = "find_all"), @Result(property = "projectView", column = "project_view"), @Result(property = "contractEntry", column = "contract_entry")})
    Role findRoleById(int i);
}